package org.geektimes.validator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;

/**
 * @FileName: PhoneValid
 * @Description: 中国大陆手机号校验
 * @Author: MaWenHao
 * @Created: 2021/3/10 - 下午9:51
 */
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Constraint(
        validatedBy = PhoneValidator.class
)
public @interface PhoneValid {

    String message() default "手机号格式不符合规范";

    String value() default "^[1]\\d{10}$";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
